﻿using System;
using Freshbooks.XmlSerializers;

namespace Freshbooks.Model
{
    [FreshbooksSerialization(Name = "payment")]
    public class Payment
    {
        [FreshbooksSerialization(Name = "payment_id")]
        public int PaymentId { get; set; }

        [FreshbooksSerialization(Name = "invoice_id")]
        public int InvoiceId { get; set; }

        [FreshbooksSerialization(Name = "date")]
        public DateTime Date { get; set; }

        [FreshbooksSerialization(Name = "type")]
        public string Type { get; set; }

        [FreshbooksSerialization(Name = "notes")]
        public string Notes { get; set; }

        [FreshbooksSerialization(Name = "client_id")]
        public int ClientId { get; set; }

        [FreshbooksSerialization(Name = "currency_code")]
        public string CurrencyCode { get; set; }

        [FreshbooksSerialization(Name = "updated")]
        public DateTime Updated { get; set; }

        [FreshbooksSerialization(Name = "amount")]
        public float Amount { get; set; }

        public GatewayTransaction Transaction { get; set; }

        [FreshbooksSerialization(Name = "gateway_transaction")]
        public class GatewayTransaction
        {
            [FreshbooksSerialization(Name = "reference_id")]
            public string ReferenceId { get; set; }

            [FreshbooksSerialization(Name = "gateway_name")]
            public string GatewayName { get; set; }
        }
    }
}
